﻿<UserControl x:Class="GeoFinderClientApp.View.UserControls.PushSettingsControlList"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:tk="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:vm="clr-namespace:GeoFinderClientApp.ViewModel"
    xmlns:converters="clr-namespace:GeoFinderClientApp.Converters"
    xmlns:toolkitPrimitives="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:block="clr-namespace:GeoFinderClientApp.Utils.Blocking"
    mc:Ignorable="d"
    d:DesignHeight="480" d:DesignWidth="480">

    <UserControl.Resources>
        <converters:PushOptionsConverter x:Key="PushEnumConverter"/>
        <converters:BoolBrushConverter x:Key="BoolBrushConverter" />
        <converters:PushDescriptionConverter x:Key="PushDescriptionConverter" />
        <!--<vm:ViewModels x:Key="ViewModelsDataSource" d:IsDataSource="True"/>-->
    	<Style x:Key="DescTextStyle" TargetType="TextBlock">
    		<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
            <Setter Property="FontSize" Value="18" />
    		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
    		<Setter Property="TextWrapping" Value="Wrap" />
    		<Setter Property="Margin" Value="16,-38,16,24" />
    	</Style>
    </UserControl.Resources>

	<!--<UserControl.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</UserControl.FontFamily>
	<UserControl.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</UserControl.FontSize>
	<UserControl.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</UserControl.Foreground>-->

    <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
        <ListBox x:Name="PushOptions" ItemsSource="{Binding}" SelectionChanged="PushOptions_SelectionChanged">
			<ListBox.ItemTemplate>
                <DataTemplate>
					    <Grid>
                        <StackPanel>
                            <!--<Grid.ColumnDefinitions>
						    <ColumnDefinition Width="0.712*"/>
						    <ColumnDefinition Width="0.288*"/>
					    </Grid.ColumnDefinitions>-->

                            <!--<TextBlock VerticalAlignment="Center" Grid.Column="0" Text="{Binding Path=Name, Mode=OneWay, Converter={StaticResource PushEnumConverter}}" />-->
                            <toolkitPrimitives:ToggleSwitch Width="460" HorizontalAlignment="Stretch" FontSize="22"
                                Header="{Binding Path=Name, Mode=OneWay, Converter={StaticResource PushEnumConverter}}"
                                IsChecked="{Binding Path=IsEnabled, Mode=TwoWay}" />
                            <TextBlock Style="{StaticResource DescTextStyle}" 
                                       Text="{Binding Path=Name, Mode=OneWay, Converter={StaticResource PushDescriptionConverter}}"/>
                            <!--<Border Background="{Binding Path=IsEnabled, Mode=OneWay, Converter={StaticResource BoolBrushConverter}}" />-->
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
